package personal.xjl._23java1studentdemo.spring;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component()
@Data@NoArgsConstructor@AllArgsConstructor
public class Cow {
     @Value("niumowang")
     String name;
     @Value("500")
     double weight;

     public void run() {
          System.out.println(name + " (体重: " + weight + "kg) 正在奔跑...");
     }


}
